package com.z6pin.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import com.z6pin.entity.Users;
import com.z6pin.service.UserService;

@Service
public class AsyncTaskService {

	@Autowired
	UserService userService;
	
	@Async
	public void executeAysncTaskReduce(Integer i) {
		System.out.println("execute :"+i);
		try {
			Users user = new Users("","","");
			user.setId(Long.valueOf(2));
			user.setAccount(5);
			//System.out.println("userService:"+userService);
			userService.reduce(user);
		}catch(Exception e) {
			e.printStackTrace();
		}
		
        
	}
	
}
